\chapter{Vectors and Geometry}
\label{chap:vectors_geometry}


%%-------------------------------------------------------------------------%%
%%--- Vectors: magnitude and direction ------------------------------------%%

\section{Vectors: magnitude and direction}
\label{sec:vectors_magnitude_directions}

Differential calculus is useful for analyzing changing quantities such
as the speed and velocity of an aeroplane.  What if you also want to
analyze the direction in which the aeroplane is travelling? The path
of an aeroplane travelling from Australia to the U.S. is characterized
by two quantities or \emph{scalars}:\index{scalars} a magnitude~(such
as speed), and a direction~(from Australia to the U.S.).  Both of
these two scalars are captured in a single object called a
\emph{vector}.\index{vectors}

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
% grids for the plane
\draw[step=1cm,lightgray,very thin] (-0.5,-0.5) grid (6.5,5.5);
% the rectangular axes
\draw[->,>=stealth,semithick] (-0.5,0) -- (6.5,0) node[right]{$x$};
\draw[->,>=stealth,semithick] (0,-0.5) -- (0,5.5) node[above]{$y$};
% vectors
\draw[->,>=stealth,very thick] (0,3) -- node[above left]{$\textbf{u}$} (2,5);
\draw[->,>=stealth,very thick] (1.5,3.3) -- node[below right]{$\textbf{v}$} (3.5,5.3);
\draw[->,>=stealth,very thick] (0.5,1.5) -- node[below right]{$\textbf{w}$} (2.5,3.5);
\draw[->,>=stealth,very thick] (3.5,0.5) -- (5.5,0.5);
\draw[->,>=stealth,very thick] (5.7,0.7) -- (5.7,2.7);
\draw[->,>=stealth,very thick] (5.5,2.5) -- (3.5,2.5);
\draw[->,>=stealth,very thick] (3.3,2.3) -- (3.3,0.3);
\end{tikzpicture}
\caption{Vectors in the $x$-$y$ plane.}
\label{fig:plane_vectors}
\end{figure}


%%-------------------------------------------------------------------------%%
%%--- Vectors in the plane ------------------------------------------------%%

\subsection{Vectors in the plane}
\label{subsec:vectors_in_plane}
\index{vectors!two-dimensional}

In the $x$-$y$ plane, we can visualize a vector as an arrow from point
$A$ to point $B$~(see Figure~\ref{fig:plane_vectors}). The starting
point $A$ of the vector is called the \emph{tail}\index{vectors!tail}
and the terminal point $B$ is the \emph{head}.\index{vectors!head} Two
vectors are \emph{equivalent}\index{vectors!equivalent} if they have
the same magnitude and direction. The vectors \textbf{u}, \textbf{v},
and \textbf{w} in Figure~\ref{fig:plane_vectors} are thus all
equivalent to each other.

To analyze vectors using algebra, we can think of a vector \textbf{u}
as starting from the origin of the $x$-$y$ plane and having $(u_1,
u_2)$ as the coordinate for its head~(see
Figure~\ref{fig:specify_vector_head_coordinate}). So \textbf{u} is
completely determined by the coordinate of its head and we write
$\textbf{u} = \langle u_1, u_2 \rangle$ as an algebraic representation
for \textbf{u}.

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
% the rectangular axes
\draw[->,>=stealth,semithick] (-0.3,0) -- (4,0) node[right]{$x$};
\draw[->,>=stealth,semithick] (0,-0.3) -- (0,3.5) node[above]{$y$};
% vector described by its head coordinate
\draw[->,>=stealth,very thick] (0,0) -- node[above left]{\textbf{u}} (3,2.5) node[below right]{$(u_1, u_2)$};
\end{tikzpicture}
\caption{A vector as specified by its head coordinate.}
\label{fig:specify_vector_head_coordinate}
\end{figure}

In case the tail of \textbf{u} is not the origin, we let $(x_1, y_1)$
be the coordinate of the tail and denote the coordinate of the head by
$(x_2, y_2)$. By subtracting coordinatewise, we obtain an equivalent
vector \textbf{v} that emanates from the origin of the $x$-$y$
plane. The coordinate of \textbf{v} is
\[
(x_2, y_2) - (x_1, y_1)
=
(x_2 - x_1,\; y_2 - y_1)
=
(u_1, u_2)
\]
and we do not distinguish between \textbf{u} and \textbf{v}. Thus we
can transform \textbf{u} to be a vector emanating from the origin and
specified by the coordinate
%
\begin{equation}
\label{eq:component_form_vector}
\textbf{u}
=
\langle x_2 - x_1,\; y_2 - y_1 \rangle
=
\langle u_1, u_2 \rangle.
\end{equation}
%
Equation~(\ref{eq:component_form_vector}) is called the
\emph{component form}\index{component form} of a vector, with $u_1$
and $u_2$ being the individual components. The vector
$\textbf{0} = \langle 0, 0 \rangle$ is called the zero
vector.\index{zero vector}

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
% the rectangular axes
\draw[->,>=stealth,semithick] (-2.5,0) -- (5.7,0) node[right]{$x$};
\draw[->,>=stealth,semithick] (0,-1.5) -- (0,6.7) node[above]{$y$};
% ticks on horizontal axis
\foreach \x in {-2,-1,-1}
  \draw (\x cm,2pt) -- (\x cm,-2pt) node[anchor=north] {$\x$};
\foreach \x in {1,2,...,5}
  \draw (\x cm,2pt) -- (\x cm,-2pt) node[anchor=north] {$\x$};
% ticks on vertical axis
\foreach \y in {-1,-1}
  \draw (2pt,\y cm) -- (-2pt,\y cm) node[anchor=east] {$\y$};
\foreach \y in {1,2,...,6}
  \draw (2pt,\y cm) -- (-2pt,\y cm) node[anchor=east] {$\y$};
% vector u
\draw[->,>=stealth,very thick] (-2,-1) node[below]{$(-2,-1)$} -- node[above left]{\textbf{u}} (1,3) node[above]{$(1,3)$};
% vector v
\draw[->,>=stealth,very thick] (1.5,1.5) node[below]{$(1.5,1.5)$} -- node[above left]{\textbf{v}} (4.5,5.5) node[above]{$(4.5,5.5)$};
\end{tikzpicture}
\caption{Verify that vectors \textbf{u} and \textbf{v} are
  equivalent.}
\label{fig:verify_vectors_u_v}
\end{figure}

\begin{example}
Let the vector \emph{\textbf{u}} be described by the directed line segment
from $(-2,-1)$ to $(1,3)$, and let \emph{\textbf{v}} be the line segment from
$(1.5,1.5)$ to $(4.5,5.5)$, as shown in
Figure~\ref{fig:verify_vectors_u_v}. Show that \emph{\textbf{u}} and
\emph{\textbf{v}} are equivalent vectors.
\end{example}

\begin{proof}[Solution]
To show that \textbf{u} and \textbf{v} are equivalent, we need to show
that they have the same length and are in the same direction. The
length of \textbf{u} is equivalent to the length of the line segment
from $(-2,-1)$ to $(1,3)$:
%
\begin{align*}
\sqrt{(1 - (-2))^2 + (3 - (-1))^2}
&=
\sqrt{(1 + 2)^2 + (3 + 1)^2} \\
&=
\sqrt{9 + 16} \\
&=
5.
\end{align*}
%
This tells us that \textbf{u} has length 5. Similarly, the length of
\textbf{v} is
%
\begin{align*}
\sqrt{(4.5 - 1.5)^2 + (5.5 - 1.5)^2}
&=
\sqrt{3^2 + 4^2} \\
&=
\sqrt{9 + 16} \\
&=
5
\end{align*}
%
which is the same length as that of \textbf{u}. The slope of the line
segment from $(-2,-1)$ to $(1,3)$ is
\[
\frac{3 - (-1)} {1 - (-2)}
=
\frac{4}{3}
\]
and the slope of the line segment from $(1.5,1.5)$ to $(4.5,5.5)$ is
\[
\frac{5.5 - 1.5}{4.5 - 1.5}
=
\frac{4}{3}
\]
which shows that these two line segments have the same direction, so
\textbf{u} and \textbf{v} point in the same direction. Therefore,
\textbf{u} and \textbf{v} are equivalent vectors.
\end{proof}

\begin{practice}
Consider the vectors in Figure~\ref{fig:verify_vectors_u_v}. Find the
component forms of those vectors. Use the component forms to show that
the vectors are equivalent.
\end{practice}

We denote the length of a vector as follows. Let \textbf{u} be a
vector whose starting point is $P = (x_1, y_1)$ and whose terminal
point is $Q = (x_2, y_2)$. Then the length or magnitude of \textbf{u}
is denoted by $\left\Arrowvert \textbf{u} \right\Arrowvert$ and given
by the equation
%
\begin{equation}
\label{eq:magnitude_two_dimensional_vector}
\begin{aligned}
\left\Arrowvert \textbf{u} \right\Arrowvert
&=
\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \\
&=
\sqrt{v_1^2 + v_2^2}.
\end{aligned}
\end{equation}


%%-------------------------------------------------------------------------%%
%%--- Add, subtract, and multiply vectors ---------------------------------%%

\subsection{Add, subtract, and multiply vectors}
\index{vectors!arithmetic}
%% Relate vectors with complex numbers.

Objects usually move in one direction at one time, and then in a
different direction at another time. The left-hand side of
Figure~\ref{fig:vector_sum} illustrates the path of an object. The
object initially travels in the direction of the vector \textbf{u},
then it travels in the direction of \textbf{v}. We can represent the
total displacement of the object as the vector $\textbf{u} +
\textbf{v} = \textbf{w}$. Furthermore, it is also reasonable to first
go in the direction of \textbf{v} and then in that of \textbf{u}, and
hence obtain the same displacement $\textbf{v} + \textbf{u} =
\textbf{w}$, as shown on the right-hand side of
Figure~\ref{fig:vector_sum}. This ``adding'' of vectors is just one of
many basic operations that can be performed on vectors. In fact, the
``adding'' rule illustrated in Figure~\ref{fig:vector_sum} is called
the \emph{parallelogram rule}\index{parallelogram rule} for vector
addition.

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
% left set of vectors
\node (start1) at (0,0) [circle,fill=blue,inner sep=1.5pt]{};
\node (middle1) at (3,0.1) [circle,inner sep=0.5pt]{};
\node (finish1) at (3.4,1.6) [circle,fill=blue,inner sep=1.5pt]{};
\draw[->,>=stealth,very thick] (start1) node[below left]{start}  -- node[below]{$\textbf{u}$} (middle1);
\draw[->,>=stealth,very thick] (middle1) -- node[right]{$\textbf{v}$} (finish1) node[above right]{finish};
\draw[->,>=stealth,very thick] (start1) -- node[above]{$\textbf{w}$} (finish1);
% right set of vectors
\node (start2) at (6,0) [circle,fill=blue,inner sep=1.5pt]{};
\node (lowerMiddle) at (9,0.1) [circle,inner sep=0.5pt]{};
\node (upperMiddle) at (6.4,1.5) [circle,inner sep=0.5pt]{};
\node (finish2) at (9.4,1.6) [circle,fill=blue,inner sep=1.5pt]{};
\draw[->,>=stealth,very thick] (start2) node[below left]{start} -- node[below]{$\textbf{u}$} (lowerMiddle);
\draw[->,>=stealth,very thick] (lowerMiddle) -- node[right]{$\textbf{v}$} (finish2) node[above right]{finish};
\draw[->,>=stealth,shorten >=3pt,very thick] (start2) -- node[above]{$\textbf{w}$} (finish2);
\draw[->,>=stealth,very thick,dash pattern=on 4pt off 4pt] (start2) -- node[left]{$\textbf{v}$} (upperMiddle);
\draw[->,>=stealth,very thick,dash pattern=on 4pt off 4pt] (upperMiddle) -- node[above]{$\textbf{u}$} (finish2);
\end{tikzpicture}
\caption{The vector sum $\textbf{u} + \textbf{v} = \textbf{w} =
  \textbf{v} + \textbf{u}$.}
\label{fig:vector_sum}
\end{figure}

\begin{definition}
\label{def:vector_operations}
Let $\emph{\textbf{u}} = \langle u_1, u_2 \rangle$ and
$\emph{\textbf{v}} = \langle v_1, v_2 \rangle$ be vectors and suppose
$c$ is a scalar. Then we have the following operations on vectors:
\begin{enumerate}
\item The \emph{vector sum} of \emph{\textbf{u}} and
  \emph{\textbf{v}} is $\emph{\textbf{u}} + \emph{\textbf{v}} =
  \langle u_1 + v_1,\; u_2 + v_2 \rangle$.

\item The \emph{negative} of \emph{\textbf{u}} is
  $-\emph{\textbf{u}} = \langle -u_1, -u_2 \rangle$.

\item The \emph{vector difference} of \emph{\textbf{u}} and
  \emph{\textbf{v}} is $\emph{\textbf{u}} - \emph{\textbf{v}} =
  \langle u_1, u_2 \rangle - \langle v_1, v_2 \rangle = \langle u_1 -
  v_1,\; u_2 - v_2 \rangle$.

\item The \emph{scalar multiple} of $c$ and \emph{\textbf{u}} is $c
  \emph{\textbf{u}} = \langle c u_1, c u_2 \rangle$.
\end{enumerate}
\end{definition}

The negative of a vector \textbf{u} is a vector that has the same
length as \textbf{u}, but goes in the opposite direction. One
exception is the zero vector \textbf{0}, whose negative is itself
because $-\textbf{0} = -\langle 0,0 \rangle = \langle -0, -0 \rangle =
\langle 0,0 \rangle = \textbf{0}$. More generally, scalar
multiplication has the effect of scaling a vector. This may result in
expanding the vector, contracting it, producing the negative of the
vector, or expanding/contracting the negative of the vector. These
various possibilities are shown in
Figure~\ref{fig:scalar_multiply_negative}.

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
\draw[->,>=stealth,very thick] (0,0) -- (1,1) node[above]{$\textbf{u}$};
\draw[<-,>=stealth,very thick] (1,0) -- (2,1) node[above]{$-\textbf{u}$};
\draw[->,>=stealth,very thick] (2,0) -- (2.5,0.5) node[above right]{$\frac{1}{2}\textbf{u}$};
\draw[->,>=stealth,very thick] (3,0) -- (5,2) node[above]{$2\textbf{u}$};
\draw[<-,>=stealth,very thick] (4,0) -- (5.5,1.5) node[above right]{$-\frac{3}{4}\textbf{u}$};
\end{tikzpicture}
\caption{Scalar multiplication and negative of a vector.}
\label{fig:scalar_multiply_negative}
\end{figure}

Using the parallelogram rule for vector addition, we can similarly
illustrate vector difference. The left-hand side of
Figure~\ref{fig:vector_difference_parallelogram_triangle} shows the
parallelogram rule for vector subtraction, while the right-hand side shows
the triangle rule for vector subtraction. Thus to determine the
difference of two vectors \textbf{u} and \textbf{v}, we first align the
vectors so that their initial points coincide. Then the difference
$\textbf{u} - \textbf{v}$ is the vector that starts from the head of
\textbf{v} and ends at the terminal point of \textbf{u}.

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
% left-hand figure: vector difference by parallelogram rule
\node (origin) at (0,0) [circle,fill=blue,inner sep=1.5pt]{};
\node (destin) at (-1.7,2) [circle,fill=blue,inner sep=1.5pt]{};
\draw[->,>=stealth,very thick] (origin) -- node[below]{$\textbf{v}$} (2.5,0);
\draw[->,>=stealth,very thick] (origin) -- node[below]{$-\textbf{v}$} (-2.5,0);
\draw[->,>=stealth,very thick] (origin) -- node[right]{$\textbf{u}$} (0.8,2);
\draw[->,>=stealth,very thick,dash pattern=on 4pt off 4pt] (-2.5,0) -- node[left]{$\textbf{u}$} (destin);
\draw[->,>=stealth,very thick,dash pattern=on 4pt off 4pt] (0.5,2) -- node[above]{$-\textbf{v}$} (destin);
\draw[->,>=stealth,very thick] (origin) -- node[right]{$\textbf{u} - \textbf{v}$} (destin);
% right-hand figure: vector difference
\draw[->,>=stealth,very thick] (4.5,0) -- node[left]{$\textbf{u}$} (5.3,2);
\draw[->,>=stealth,very thick] (4.5,0) -- node[below]{$\textbf{v}$} (7,0);
\draw[->,>=stealth,very thick] (7,0) -- node[right]{$\textbf{u} - \textbf{v}$} (5.3,2);
\end{tikzpicture}
\caption{Vector difference by the parallelogram rule~(left) and by the
triangle rule~(right).}
\label{fig:vector_difference_parallelogram_triangle}
\end{figure}

\begin{practice}
\label{prac:linear_magnitude}
Use property~4~(scalar multiplication) of
Definition~\ref{def:vector_operations} to show that $\left\Arrowvert c
\emph{\textbf{u}} \right\Arrowvert = \left\arrowvert c
\right\arrowvert \, \left\Arrowvert \emph{\textbf{u}} \right\Arrowvert$.
\end{practice}

Vector operations share many of the familiar properties of operations
on real numbers. Given two real numbers, for example, it does not
matter in which order we add them. The following theorem shows various
properties of real numbers that are also shared by vectors.

\begin{theorem}
\label{thm:vector_properties}
Let \emph{\textbf{u}}, \emph{\textbf{v}} and \emph{\textbf{w}} be
vectors, and suppose $c$ and $d$ are scalars. Then vectors have the
following properties.
\begin{enumerate}
\item Commutative addition: $\emph{\textbf{u}} + \emph{\textbf{v}} =
  \emph{\textbf{v}} + \emph{\textbf{u}}$.

\item Associative addition: $(\emph{\textbf{u}} + \emph{\textbf{v}}) +
  \emph{\textbf{w}} = \emph{\textbf{u}} + (\emph{\textbf{v}} +
  \emph{\textbf{w}})$.

\item Additive identity: $\emph{\textbf{u}} + \emph{\textbf{0}} =
  \emph{\textbf{u}} = \emph{\textbf{0}} + \emph{\textbf{u}}$.

\item Additive inverse: $\emph{\textbf{u}} + (-\emph{\textbf{u}}) =
  \emph{\textbf{0}} = (-\emph{\textbf{u}}) + \emph{\textbf{u}}$.

\item Associative scalar multiplication: $c (d \emph{\textbf{u}}) =
  (cd) \emph{\textbf{u}}$.

\item Distributive over scalar addition: $(c + d) \emph{\textbf{u}} =
  c\emph{\textbf{u}} + d\emph{\textbf{u}}$.

\item Distributive over vector addition: $c (\emph{\textbf{u}} +
  \emph{\textbf{v}}) = c\emph{\textbf{u}} + c\emph{\textbf{v}}$.

\item Multiplicative identity: $1 (\emph{\textbf{u}}) =
  \emph{\textbf{u}} = (\emph{\textbf{u}}) 1$.

\item Multiplication by zero: $0 (\emph{\textbf{u}}) =
  \emph{\textbf{0}} = (\emph{\textbf{u}}) 0$.
\end{enumerate}
\end{theorem}

\begin{example}
Using Theorem~\ref{thm:vector_properties}, find a vector
\emph{\textbf{x}} such that $5\emph{\textbf{x}} + 7\emph{\textbf{u}} =
4\emph{\textbf{v}}$.
\end{example}

\begin{proof}[Solution]
First, use property~2 of Theorem~\ref{thm:vector_properties} to get
$5\textbf{x} + (7\textbf{u} - 7\textbf{u}) = 4\textbf{v} -
7\textbf{u}$, which by properties~4 and~3 can be simplified to
$5\textbf{x} = 4\textbf{v} - 7\textbf{u}$. Now divide both sides of
the last equation by 5 to get $\frac{1}{5}(5\textbf{x}) = \frac{1}{5}
(4\textbf{v} - 7\textbf{u})$ and use properties~5 and~7 to simplify it
to $\textbf{x} = \frac{1}{5} (4\textbf{v}) +
\frac{1}{5}(-7\textbf{u})$. Another application of property~5 shows
that the required vector \textbf{x} is $\textbf{x} =
\frac{4}{5}\textbf{v} - \frac{7}{5}\textbf{u}$.
\end{proof}

\begin{practice}
\label{prac:triangle_inequality_two_dimensions}
Let $\emph{\textbf{u}} = \langle 3, 4 \rangle$ and $\emph{\textbf{v}}
= \langle 9, 11 \rangle$. Show that $\left\Arrowvert \emph{\textbf{u}}
+ \emph{\textbf{v}}\right\Arrowvert \leq \left\Arrowvert
\emph{\textbf{u}} \right\Arrowvert + \left\Arrowvert \emph{\textbf{v}}
\right\Arrowvert$.
\end{practice}

\begin{practice}
Let $\emph{\textbf{u}} = \langle u_1, u_2 \rangle$ and
$\emph{\textbf{v}} = \langle v_1, v_2 \rangle$. Prove the vector
properties in Theorem~\ref{thm:vector_properties}.
\end{practice}

\begin{theorem}
\label{thm:unit_vector}
Let \emph{\textbf{v}} be a non-zero vector. Then the vector
%
\begin{equation}
\label{eq:two_dimensional_unit_vector}
\emph{\textbf{u}}
=
\frac {\emph{\textbf{v}}} {\left\Arrowvert \emph{\textbf{v}} \right\Arrowvert}
=
\emph{\textbf{v}}
\frac {1} {\left\Arrowvert \emph{\textbf{v}} \right\Arrowvert}
\end{equation}
%
has magnitude $1$ and is in the same direction as \emph{\textbf{v}}.
\end{theorem}

\begin{proof}
Let $\textbf{v} = \langle v_1, v_2 \rangle$. Then the magnitude of
\textbf{v} is $\left\Arrowvert \textbf{v} \right\Arrowvert =
\sqrt{v_1^2 + v_2^2}$. Let $a$ be the scalar
\[
a
=
\frac {1} {\sqrt{v_1^2 + v_2^2}}
=
\frac {1} {\left\Arrowvert \textbf{v} \right\Arrowvert}.
\]
Using the result from Practice~\ref{prac:linear_magnitude}, the
magnitude of \textbf{u} is
%
\begin{align*}
\left\Arrowvert \textbf{v} a \right\Arrowvert
&=
|a| \, \left\Arrowvert \textbf{v} \right\Arrowvert \\
&=
a \sqrt{v_1^2 + v_2^2} \\
&=
\frac {\sqrt{v_1^2 + v_2^2}} {\sqrt{v_1^2 + v_2^2}}
\end{align*}
%
which simplifies to 1. Now $a$ is positive since \textbf{v} is
non-zero. Then $\textbf{v}a = \langle v_1 a,\, v_2 a \rangle$ has the
effect of contracting or expanding \textbf{v}, without changing its
direction.
\end{proof}

The process of using equation~(\ref{eq:two_dimensional_unit_vector})
to transform a non-zero vector into a vector of magnitude 1 is called
\emph{normalizing}\index{vectors!normalization} a vector. For example,
given the vector $\textbf{u} = \langle 1, 2 \rangle$, we can use
equation~(\ref{eq:two_dimensional_unit_vector}) to find the normalized
form of \textbf{u}. Since $\left\Arrowvert \textbf{u} \right\Arrowvert
= \sqrt{5}$ by equation~(\ref{eq:magnitude_two_dimensional_vector}),
so \textbf{u} is normalized as
\[
\frac {\textbf{u}} {\left\Arrowvert \textbf{u} \right\Arrowvert}
=
\frac{1}{\sqrt{5}} \langle 1, 2 \rangle.
\]


%%-------------------------------------------------------------------------%%
%%--- Applications to geometry --------------------------------------------%%

\subsection{Applications to geometry}
\label{subsec:2D_vectors_apply_geometry}

A line in the $x$-$y$ plane is usually described by the linear
equation
\[
y = mx + c
\]
where $m \neq 0$ is the slope of the line and $c$ is a constant. The
same line can be represented in \emph{vector form}\index{vector form}
as
%
\begin{equation}
\label{eq:vector_form_line}
\langle x,\, mx + c \rangle
=
\langle 0, c \rangle + x \langle 1, m \rangle.
\end{equation}
%
The vector $\langle 0, c \rangle$ points to the line, while the vector
$\langle 1, m \rangle$ is in the same direction as the line.

\begin{example}
Express the line $2x + 3y = 4$ in vector form.
\end{example}

\begin{proof}[Solution]
Solving the equation $2x + 3y = 4$ for $y$ to get
\[
y = \frac{4}{3} - \frac{2}{3} x.
\]
Using equation~(\ref{eq:vector_form_line}), we have
\[
\langle 0,\, 4/3 \rangle
+ x \langle 1,\, -2/3 \rangle
\]
which is a representation of the line $2x + 3y = 4$ in vector form.
\end{proof}

\begin{practice}
Let $(2, 17)$ and $(1/5,\, 8)$ be two points on a line $\ell$. Find a
linear equation describing $\ell$. Express $\ell$ in vector form.
\end{practice}

In general, a line $L$ has many different vector representations. If
$(u_1, u_2)$ is a point on $L$, then $\textbf{u} = \langle u_1, u_2
\rangle$ is a vector pointing to $L$. Furthermore, let $\textbf{v} =
\langle v_1, v_2 \rangle$ be a vector in the same direction as
$L$. Then the line $L$ can be represented in vector form as
\[
\langle x, y \rangle
=
\textbf{u} + t \textbf{v}
\]
with $t$ being a parameter.

Two non-zero vectors \textbf{u} and \textbf{v} are said to be
\emph{linearly dependent}\index{linearly dependent} if they can be
expressed as a linear combination that equals the zero vector. In
other words, we can find two non-zero numbers $m,n \in \mathbb{R}$
such that $m\textbf{u} + n\textbf{v} = \textbf{0}$. From this
definition, we have the following result concerning parallel vectors.

\begin{theorem}
\label{thm:parallel_vectors_iff_linearly_dependent}
Two vectors are parallel if and only if they are linearly dependent.
\end{theorem}

\begin{proof}
First, assume that \textbf{u} and \textbf{v} are linearly
dependent. By definition, we can find two non-zero numbers $m,n \in
\mathbb{R}$ such that $m\textbf{u} + n\textbf{v} =
\textbf{0}$. Using vector properties in
Theorem~\ref{thm:vector_properties} to solve the last equation for
\textbf{u}, we obtain $\textbf{u} = -\frac{n}{m} \textbf{v}$. Since
\textbf{v} is in the same direction as \textbf{u}, it follows that
they are parallel vectors.

Now assume that \textbf{u} and \textbf{v} are parallel vectors. This
means that one is a non-zero scalar multiple of the other. Thus
$\textbf{u} = k \textbf{v}$ for some $k \neq 0$. Again, use vector
properties in Theorem~\ref{thm:vector_properties} to bring everything
to the left-hand side to get $\textbf{u} - k \textbf{v} =
\textbf{0}$. In the last equation, notice that $m = 1$ and $n = -k$,
both of which are not zero. Therefore \textbf{u} and \textbf{v} are
linearly dependent.
\end{proof}


%%-------------------------------------------------------------------------%%
%%--- Vectors in three-dimensional space ----------------------------------%%

\subsection{Vectors in three-dimensional space}
\index{vectors!three-dimensional}

Just as vectors in the plane are described by two components, so
vectors in three-dimensional space are described by three components,
as shown in Figure~\ref{fig:3_D_vector}. If \textbf{u} is a vector
whose tail is the origin $(0,0,0)$ and whose head is $(u_1, u_2,
u_3)$, then the component form of \textbf{u} is $\textbf{u} = \langle
u_1, u_2, u_3 \rangle$. Moving from two dimensions to three does not
change many of the vector results presented earlier in this section. In
fact, the magnitude of \textbf{u} is similarly defined as
%
\begin{equation}
\label{eq:magnitude_three_dimensional_vector}
\left\Arrowvert \textbf{u} \right\Arrowvert
=
\sqrt{u_1^2 + u_2^2 + u_3^2}
\end{equation}
%
and if $\textbf{u} \neq \textbf{0}$ then its normalized form is
\begin{equation}
%
\label{eq:normalize_vector_three_dimensions}
\frac{\textbf{u}}{\left\Arrowvert \textbf{u} \right\Arrowvert}
=
\textbf{u} \frac{1}{\left\Arrowvert \textbf{u} \right\Arrowvert}.
\end{equation}
%
Definition~\ref{def:vector_operations} can be easily cast in terms of
vectors in three-dimensional space; we simply add an extra
component. Theorems~\ref{thm:vector_properties}, \ref{thm:unit_vector},
and~\ref{thm:parallel_vectors_iff_linearly_dependent} also hold for
such vectors.

\begin{figure}[!htpb]
\centering
\begin{pspicture}(-1,-2)(4,4)
\pstThreeDCoor[linecolor=black,Alpha=-280,xMin=-0.5,xMax=4,yMin=-0.5,yMax=4,zMin=-0.5,zMax=4]
\pstThreeDDot[linecolor=blue,dotsize=4pt](1,4,5)\uput[0](2,2.8){$(u_1, u_2, u_3)$}
\pstThreeDLine[linewidth=1.5pt,arrows=->](0,0,0)(1,4,5)\uput[0](0.5,1.5){$\textbf{u}$}
\pstThreeDLine[linewidth=0.5pt,linecolor=blue,linestyle=dashed](0,0,0)(1,4,0)
\pstThreeDLine[linewidth=0.5pt,linecolor=blue,linestyle=dashed](1,4,0)(1,4,5)
\end{pspicture}
\caption{A vector in three-dimensional space.}
\label{fig:3_D_vector}
\end{figure}

\begin{practice}
Let \emph{\textbf{u}} be a three-dimensional vector and let $c$ be a
scalar. Show that $\left\Arrowvert c \emph{\textbf{u}}
\right\Arrowvert = |c| \, \left\Arrowvert \emph{\textbf{u}}
\right\Arrowvert$.
\end{practice}

\begin{practice}
\label{prac:triangle_inequality_three_dimensions}
Given two vectors $\emph{\textbf{u}} = \langle 3, 5, 7 \rangle$ and
$\emph{\textbf{v}} = \langle -1, 2, 9 \rangle$, show that
$\left\Arrowvert \emph{\textbf{u}} + \emph{\textbf{v}}
\right\Arrowvert \leq \left\Arrowvert \emph{\textbf{u}}
\right\Arrowvert + \left\Arrowvert \emph{\textbf{v}} \right\Arrowvert$.
\end{practice}

\begin{figure}[!htpb]
\centering
\begin{pspicture}(-3,-1)(3,3)
\pstThreeDCoor[linecolor=black,xMin=-0.5,xMax=3,yMin=-0.5,yMax=3,zMin=-0.5,zMax=3]
\pstThreeDLine[linewidth=1.5pt,arrows=->](0,0,0)(2,0,0)
\pstThreeDLine[linewidth=1.5pt,arrows=->](0,0,0)(0,2,0)
\pstThreeDLine[linewidth=1.5pt,arrows=->](0,0,0)(0,0,2)
\uput[0](-2.7,-0.5){$(1,0,0)$}\uput[0](-1,-0.1){\textbf{i}}
\uput[0](1.2,-0.4){$(0,1,0)$}\uput[0](0.5,0){\textbf{j}}
\uput[0](-0.1,1.8){$(0,0,1)$}\uput[0](0,1){\textbf{k}}
\end{pspicture}
\caption{Unit vectors in three-dimensional space.}
\label{fig:unit_vectors_3_D}
\end{figure}

If a non-zero vector \textbf{u} (in two- or three-dimensional space) is
multiplied by $1 / \left\Arrowvert \textbf{u} \right\Arrowvert$, the
result is a vector of magnitude 1. Vectors of magnitude 1 are called
\emph{unit vectors}.\index{unit vectors} Thus the vector in
equation~(\ref{eq:two_dimensional_unit_vector}) is a two-dimensional
unit vector. Of particular interest in physics are the
\emph{standard unit vectors}\index{standard unit vectors}
\[
\textbf{i} = \langle 1, 0 \rangle
\qquad\text{and}\qquad
\textbf{j} = \langle 0, 1 \rangle
\]
in the two-dimensional plane, and their three-dimensional
counterparts:
%
\begin{equation}
\label{eq:standard_unit_vectors_three_dimensions}
\textbf{i} = \langle 1, 0, 0 \rangle, \qquad
\textbf{j} = \langle 0, 1, 0 \rangle, \qquad
\textbf{k} = \langle 0, 0, 1 \rangle.
\end{equation}
%
The three-dimensional standard unit vectors are shown in
Figure~\ref{fig:unit_vectors_3_D}. These vectors play a role similar
to the number $1 \in \mathbb{R}$, where every $a \in \mathbb{R}$ can
be expressed as $a = a \cdot 1$. So every
three-dimensional~(respectively two-dimensional) vector $\textbf{u} =
\langle u_1, u_2, u_3 \rangle$ can be expressed in terms of the
standard unit
vectors~(\ref{eq:standard_unit_vectors_three_dimensions}) as
\[
\textbf{u}
=
\langle u_1, u_2, u_3 \rangle
=
\langle u_1, 0, 0 \rangle +
\langle 0, u_2, 0 \rangle + \langle 0, 0, u_3 \rangle
=
u_1 \textbf{i} + u_2 \textbf{j} + u_3 \textbf{k}.
\]
For example, in the plane we have $\langle 2, 3 \rangle = 2\textbf{i}
+ 3 \textbf{j}$. In three-dimensional space we have $\langle 5, -1,
7 \rangle = 5 \textbf{i} - \textbf{j} + 7 \textbf{k}$, whose magnitude
is $5\sqrt{3}$ and so $\frac{1}{5\sqrt{3}} \langle 5, -1, 7 \rangle
= \frac{1}{\sqrt{3}}\textbf{i} - \frac{1}{5\sqrt{3}}\textbf{j} +
\frac{7}{5\sqrt{3}}\textbf{k}$ is a unit vector in the same direction
as $\langle 5, -1, 7 \rangle$.

\begin{practice}
Let $\emph{\textbf{u}} = \langle 3, 7 \rangle$ and $\emph{\textbf{v}}
= \langle -2, 5, 8 \rangle$. Express \emph{\textbf{u}} and
\emph{\textbf{v}} in terms of standard unit vectors of the respective
dimensions. Normalize \emph{\textbf{u}} and \emph{\textbf{v}} and
express your results in terms of the appropriate standard unit vectors.
\end{practice}


%%-------------------------------------------------------------------------%%
%%--- Problems ------------------------------------------------------------%%

\subsection{Problems}

\begin{enumerate}
\item Consider the parallelogram in
  Figure~\ref{fig:diagonals_bisect}. The directed line segment from
  $O$ to $P$, for example, can be represented as the vector
  $\textbf{p} = \overrightarrow{OP}$. Any other directed line segments
  in the figure can be similarly represented. Show that the diagonal
  lines of the parallelogram\index{parallelogram} bisect each other.
%
\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
% parallelogram
\draw (0,0) node[below]{$O$} -- (5,0) node[below]{$A$};
\draw (0,0) -- (1,2) node[above]{$C$};
\draw (1,2) -- (6,2);
\draw (5,0) -- (6,2) node[above]{$B$};
% diagonals of the parallelogram
\draw (0,0) -- (6,2);
\draw (5,0) -- node[below]{$P$} (1,2);
\end{tikzpicture}
\caption{The diagonals bisect each other.}
\label{fig:diagonals_bisect}
\end{figure}

\item Given the vectors $\textbf{u} = \langle u_1, u_2 \rangle$ and
  $\textbf{v} = \langle v_1, v_2, v_3 \rangle$, we can represent them
  in matrix notation as\index{vectors!matrix representation}\index{matrix}
\[
\textbf{u} = \begin{bmatrix} u_1 \\ u_2 \end{bmatrix}
\qquad\text{and}\qquad
\textbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix}.
\]
Express the standard unit vectors in matrix notation. Consider the
vector operations in Theorem~\ref{thm:vector_properties}. How would
these be performed using matrix notation for vectors?

\item Consider Figure~\ref{fig:which_two_points_closest}, which shows
  the coordinates of your home~(point $H$), and that of your friends
  Emily~(point $E$) and David~(point $D$). Which of your two friends
  are closest to you? Who are closest to each other?

\begin{figure}
\centering
\begin{tikzpicture}
% grids for the plane
\draw[step=1cm,lightgray,very thin] (0,0) grid (6.5,5.5);
% the rectangular axes
\draw[->,>=stealth,semithick] (-0.5,0) -- (6.5,0) node[right]{$x$};
\draw[->,>=stealth,semithick] (0,-0.5) -- (0,5.5) node[above]{$y$};
% ticks on horizontal axis
\foreach \x in {1,2,...,6}
  \draw (\x cm,2pt) -- (\x cm,-2pt) node[anchor=north] {$\x$};
% ticks on vertical axis
\foreach \y in {1,2,...,5}
  \draw (2pt,\y cm) -- (-2pt,\y cm) node[anchor=east] {$\y$};
% points
\node[fill=black,circle,inner sep=2pt] at (1,4) {}; \node at (1.3,4.3) {$D$};
\node[fill=black,circle,inner sep=2pt] at (6,5) {}; \node at (5.7,4.7) {$E$};
\node[fill=black,circle,inner sep=2pt] at (3,1) {}; \node at (3.3,0.7) {$H$};
\end{tikzpicture}
\caption{Which two points are closest?}
\label{fig:which_two_points_closest}
\end{figure}
\end{enumerate}


%%-------------------------------------------------------------------------%%
%%--- The dot product -----------------------------------------------------%%

\section{The dot product}
\index{dot product}

Section~\ref{sec:vectors_magnitude_directions} introduced vectors and
showed how one can perform various arithmetic operations on them. In
particular, we have shown how a vector can be multiplied by a
scalar. We now consider the case of multiplying two vectors.

\begin{definition}
\label{def:vector_dot_product}
Let $\emph{\textbf{u}} = \langle u_1, u_2, u_3 \rangle$ and
$\emph{\textbf{v}} = \langle v_1, v_2, v_3 \rangle$ be
three-dimensional vectors. Then the vector \emph{dot product}
of \emph{\textbf{u}} and \emph{\textbf{v}} is defined as
\[
\emph{\textbf{u}} \cdot \emph{\textbf{v}}
=
u_1 v_1 + u_2 v_2 + u_3 v_3.
\]
\end{definition}

The vector dot product is also called the scalar or inner
product.\index{scalar product}\index{inner product} Unlike scalar
multiplication of a scalar $c$ and a vector \textbf{u}, which results
in another vector $c\textbf{u}$, the dot product of two vectors
\textbf{u} and \textbf{v} is a scalar which can be expressed in sigma
notation as
\[
\textbf{u} \cdot \textbf{v}
=
\sum_{i=1}^3 u_i v_i.
\]
A similar definition holds for two-dimensional vectors. Thus to find
the dot product of two vectors both of which are in two- or
three-dimensional space, we multiply the corresponding
components and add up the results.

\begin{practice}
Let $\emph{\textbf{u}} = \langle 3, 5, 7 \rangle$ and
$\emph{\textbf{v}} = \langle -2, 7, -9 \rangle$. Is it true that
$\emph{\textbf{u}} \cdot \emph{\textbf{v}} = \emph{\textbf{v}}
\cdot \emph{\textbf{u}}$ for these two particular vectors?
\end{practice}

We can also find the dot product of two vectors in terms of the angle
between them. If $\theta$ is the angle between two vectors \textbf{u}
and \textbf{v} in two- or three-dimensional space, then their dot
product obeys the following geometric interpretation:
\index{dot product!geometric interpretation}
%
\begin{equation}
\label{eq:geometric_interpretation_dot_product}
\textbf{u} \cdot \textbf{v}
=
\begin{cases}
\left\Arrowvert \textbf{u} \right\Arrowvert \,
\left\Arrowvert \textbf{v} \right\Arrowvert \cos\theta
&\text{if $\textbf{u} \neq \textbf{0}$ and $\textbf{v} \neq \textbf{0}$}\\
0 & \text{if $\textbf{u} = \textbf{0}$ or $\textbf{v} = \textbf{0}$}.
\end{cases}
\end{equation}
%
Using the last equation, the angle between two non-zero vectors is
given by
\begin{equation}
\label{eq:angle_between_vectors}
\theta
=
\cos^{-1} \left(
\frac {\textbf{u} \cdot \textbf{v}}
{\left\Arrowvert \textbf{u} \right\Arrowvert \,
\left\Arrowvert \textbf{v} \right\Arrowvert}
\right).
\end{equation}

\begin{example}
Consider the vectors $\emph{\textbf{u}} = \langle 3, -1, 7 \rangle$
and $\emph{\textbf{v}} = \langle -2, 5, 8 \rangle$. Find the angle
between \emph{\textbf{u}} and \emph{\textbf{v}}.
\end{example}

\begin{proof}[Solution]
To find the angle between two vectors, we use
equation~(\ref{eq:angle_between_vectors}). From
Definition~\ref{def:vector_dot_product}, the dot product of \textbf{u}
and \textbf{v} is
\[
\textbf{u} \cdot \textbf{v}
=
3(-2) + (-1)5 + 7(8)
=
45.
\]
Using equation~(\ref{eq:magnitude_three_dimensional_vector}), the
magnitude of \textbf{u} is $\left\Arrowvert \textbf{u}
\right\Arrowvert = \sqrt{9 + 1 + 49} = \sqrt{59}$ and that of
\textbf{v} is $\left\Arrowvert \textbf{v} \right\Arrowvert = \sqrt{4 +
25 + 64} = \sqrt{93}$. Substitute the value of the dot product and the
individual magnitudes into equation~(\ref{eq:angle_between_vectors})
to get
\[
\theta
= \cos^{-1} \left( \frac{45}{\sqrt{59 \cdot 93}} \right)
\]
which is the angle between \textbf{u} and \textbf{v}. This angle can
be computed using Sage as follows:
%
\begin{center}
\fontsize{10pt}{10pt}
\selectfont
\tt
\begin{lstlisting}
sage: u = vector([3, -1, 7]); v = vector([-2, 5, 8])
sage: numer = u * v
sage: denom = u.norm() * v.norm()
sage: arccos(numer / denom)
arccos(45/(sqrt(59)*sqrt(93)))
\end{lstlisting}
\end{center}
%
which is the same as what we have above.
\end{proof}

So far we have introduced the algebraic definition of the dot product
via Definition~\ref{def:vector_dot_product}, and the geometric
definition as presented in
equation~(\ref{eq:geometric_interpretation_dot_product}). Whichever of
these two definitions that we use depends on the problem at
hand. Sometimes the only information available might be the magnitude
of the vectors and their angles; at other times the vectors are only
given in component forms.

\begin{example}
Let \emph{\textbf{u}} and \emph{\textbf{v}} be non-zero vectors in the
plane. Suppose that \emph{\textbf{u}} is fixed in some position on the
plane and that it has magnitude $7$. On the other hand, suppose
\emph{\textbf{v}} has magnitude $5$ and it is allowed to rotate in any
direction by any number of degrees. What are the maximum and minimum
values of $\emph{\textbf{u}} \cdot \emph{\textbf{v}}$? Find the
directions of \emph{\textbf{u}} and \emph{\textbf{v}} that give rise
to these maximum and minimum values.
\end{example}

\begin{proof}[Solution]
As \textbf{u} and \textbf{v} are non-zero vectors with
$\left\Arrowvert \textbf{u} \right\Arrowvert = 7$ and
$\left\Arrowvert \textbf{v} \right\Arrowvert = 5$, we use
equation~(\ref{eq:geometric_interpretation_dot_product}) to obtain
$\textbf{u} \cdot \textbf{v} = 7 \cdot 5 \cos \theta = 35 \cos
\theta$. The maximum value of $\cos \theta$ is $1$, which occurs when
$\theta = 0$ so that $\cos 0 = 1$. The minimum value of $\cos
\theta$ is $-1$, which occurs when $\theta = \pi$ and so $\cos \pi =
-1$. Then the maximum value of $\textbf{u} \cdot \textbf{v}$ is $35
\cos 0 = 35$, occurring when the angle between \textbf{u} and
\textbf{v} is zero, i.e. when \textbf{u} and \textbf{v} are in the
same direction. Similarly, the minimum value of $\textbf{u} \cdot
\textbf{v}$ is $35 \cos \pi = -35$, which results when the angle
between \textbf{u} and \textbf{v} is $\pi$ radians or $180^{\circ}$,
i.e. when \textbf{u} and \textbf{v} are in opposite directions.
\end{proof}

\begin{practice}
Consider the vectors \emph{\textbf{u}} and \emph{\textbf{v}} in
Figure~\ref{fig:maximum_minimum_dot_product}. Suppose the position of
\emph{\textbf{u}} is fixed and that it has magnitude $4$. Furthermore,
\emph{\textbf{v}} has magnitude $9$ and it is free to rotate from zero
to $135$ degrees starting from the $x$-axis. Find the maximum and
minimum values of $\emph{\textbf{u}} \cdot \emph{\textbf{v}}$. Which
positions of \emph{\textbf{u}} and \emph{\textbf{v}} give rise to
these maximum and minimum values?
\end{practice}

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
% the rectangular axes
\draw[->,>=stealth,semithick] (-4,0) -- (4,0) node[right]{$x$};
\draw[->,>=stealth,semithick] (0,-0.2) -- (0,3.5) node[above]{$y$};
% vectors
\draw[->,>=stealth,very thick] (0,0) -- node[above left]{\textbf{u}} (2.5,1.2);
\draw[->,>=stealth,very thick] (0,0) -- node[above right]{\textbf{v}} (-3.5,2.8);
% angles between vectors and x-axis
\draw[->,>=stealth] (1,0) arc (0:25:1);
\node at (1.4,0.3) {$30^{\circ}$};
\draw[->,>=stealth] (-0.8,0.65) arc (135:176:1);
\node at (-1.3,0.45) {$45^{\circ}$};
\end{tikzpicture}
\caption{What are the maximum and minimum values of $\textbf{u} \cdot
  \textbf{v}$?}
\label{fig:maximum_minimum_dot_product}
\end{figure}


%%-------------------------------------------------------------------------%%
%%--- Properties of the dot product ---------------------------------------%%

\subsection{Properties of the dot product}
\label{subsec:properties_dot_product}
\index{dot product!arithmetic}

Having introduced the dot product, we can extend the result of
Theorem~\ref{thm:vector_properties} to include a number of arithmetic
properties of the dot
product. Theorem~\ref{thm:properties_dot_product} lists some of the
properties of the dot product, which hold for vectors in both two and
three dimensions.

\begin{theorem}
\label{thm:properties_dot_product}
Let \emph{\textbf{u}}, \emph{\textbf{v}}, and \emph{\textbf{w}} be
vectors and let $c$ be a scalar. Then we have the following properties
of the dot product:
%
\begin{enumerate}
\item $\emph{\textbf{u}} \cdot \emph{\textbf{u}} = \left\Arrowvert
  \emph{\textbf{u}} \right\Arrowvert^2$.

\item Commutativity: $\emph{\textbf{u}} \cdot \emph{\textbf{v}} =
  \emph{\textbf{v}} \cdot \emph{\textbf{u}}$.

\item Distributive property: $\emph{\textbf{u}} \cdot
  (\emph{\textbf{v}} + \emph{\textbf{w}}) = \emph{\textbf{u}} \cdot
  \emph{\textbf{v}} + \emph{\textbf{u}} \cdot \emph{\textbf{w}}$.

\item Associative with respect to scalar multiplication: $c
  (\emph{\textbf{u}} \cdot \emph{\textbf{v}}) = (c \emph{\textbf{u}})
  \cdot \emph{\textbf{v}} = \emph{\textbf{u}} \cdot (c \emph{\textbf{v}})$.

\item Zero vector: $\emph{\textbf{0}} \cdot \emph{\textbf{u}} = 0 =
  \emph{\textbf{u}} \cdot \emph{\textbf{0}}$.
\end{enumerate}
\end{theorem}

\begin{practice}
Let $\emph{\textbf{u}} = \langle u_1, u_2, u_3 \rangle$,
$\emph{\textbf{v}} = \langle v_1, v_2, v_3 \rangle$ and
$\emph{\textbf{w}} = \langle w_1, w_2, w_3 \rangle$ be
three-dimensional vectors and suppose $c$ is a scalar. Prove the
properties of the dot product listed in
Theorem~\ref{thm:properties_dot_product}.
\end{practice}

From plane geometry, we know that two lines are perpendicular if the
angle $\theta$ between them is $90^{\circ}$ or $\theta = \pi / 2$
radians. Now $\cos (\pi / 2) = 0$ and using
equation~(\ref{eq:geometric_interpretation_dot_product}), we see that
two non-zero vectors are perpendicular (also called
\emph{orthogonal})\index{vectors!orthogonal} if and only if their dot
product is zero.

\begin{practice}
Recall the standard unit vectors $\emph{\textbf{i}} = \langle 1, 0
\rangle$ and $\emph{\textbf{j}} = \langle 0, 1 \rangle$ in the plane,
and their three-dimensional counterparts $\emph{\textbf{i}} = \langle
1, 0, 0 \rangle$, $\emph{\textbf{j}} = \langle 0, 1, 0 \rangle$, and
$\emph{\textbf{k}} = \langle 0, 0, 1 \rangle$. Show that the
two-dimensional standard unit vectors are orthogonal. Show that any
pair of three-dimensional standard unit vectors are orthogonal.
\end{practice}


%%-------------------------------------------------------------------------%%
%%--- Projections: parallel and perpendicular vectors ---------------------%%

\subsection{Projections: parallel and perpendicular vectors}
\index{parallel vectors}
\index{perpendicular vectors}

In section~\ref{subsec:vectors_in_plane}, we resolved a
two-dimensional vector into components that are parallel to the
axes. A similar technique can be used to resolve a three-dimensional
vector into components that are also parallel to the axes. We now
present another method for resolving a vector \textbf{u} into two
components $\textbf{u}_{\text{par}}$ and $\textbf{u}_{\text{per}}$,
which are parallel and perpendicular to a given non-zero vector
\textbf{v}, respectively.

The left-hand side of
Figure~\ref{fig:resolving_u_into_parallel_perpendicular_vectors} shows
the case where the angle $\theta$ between \textbf{u} and \textbf{v} is
$0 < \theta < \pi/2$; the right-hand side of the figure shows the case
where $\pi/2 < \theta < \pi$. We can think of
$\textbf{u}_{\text{par}}$ as being the shadow\index{vectors!shadow} of
\textbf{u} cast on the line in the direction of \textbf{v}. Then the
magnitude of $\textbf{u}_{\text{par}}$ is the length of the shadow. By
the triangle rule for vector difference~(see
Figure~\ref{fig:vector_difference_parallelogram_triangle}), we have
$\textbf{u}_{\text{per}} = \textbf{u} - \textbf{u}_{\text{par}}$. All
it remains now is to find an expression for $\textbf{u}_{\text{par}}$
in terms of the known vectors \textbf{u} and \textbf{v}.

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
% left-hand side figure
\draw[->,>=stealth,very thick] (-0.5,0.03) -- (2,1.4) node[above]{\textbf{u}};
\draw[->,>=stealth,very thick] (-0.5,0.03) -- (3.3,0.258) node[below]{\textbf{v}};
\draw[->,>=stealth,very thick] (-0.5,0.03) -- node[below]{$\textbf{u}_{\text{par}}$} (2.072937,0.184375);
\draw[->,>=stealth,very thick] (-0.5,0.03) -- node[left]{$\textbf{u}_{\text{per}}$} (-0.572937,1.245625);
\draw[color=blue,semithick,dash pattern=on 4pt off 4pt] (2.072937,0.184375) -- (2,1.4);
\draw[color=blue,semithick,dash pattern=on 4pt off 4pt] (-0.572937,1.245625) -- (2,1.4);
\draw[color=blue,semithick,dash pattern=on 4pt off 4pt] (-1,0) -- (-0.5,0.03);
\draw[color=blue,semithick,dash pattern=on 4pt off 4pt] (3.3,0.258) -- (4,0.3);
\draw[->,>=stealth] (0.5,0.089999) arc (0:25:1);
\node at (0.7,0.4) {$\theta$};
%
% right-hand side figure
\draw[->,>=stealth,very thick] (8.072937,0.184375) -- (5.427063,1.245625) node[above]{\textbf{u}};
\draw[->,>=stealth,very thick] (5.5,0.03) -- (9.3,0.258) node[below]{\textbf{v}};
\draw[->,>=stealth,very thick] (8.072937,0.184375) -- node[below]{$\textbf{u}_{\text{par}}$} (5.5,0.03);
\draw[->,>=stealth,very thick] (8.072937,0.184375) -- (8,1.4) node[right]{$\textbf{u}_{\text{per}}$};
\draw[color=blue,semithick,dash pattern=on 4pt off 4pt] (8,1.4) -- (5.427063,1.245625);
\draw[color=blue,semithick,dash pattern=on 4pt off 4pt] (5.5,0.03) -- (5.427063,1.245625);
\draw[color=blue,semithick,dash pattern=on 4pt off 4pt] (9.3,0.258) -- (10,0.3);
\draw[color=blue,semithick,dash pattern=on 4pt off 4pt] (5,0) -- (5.5,0.03);
\draw[->,>=stealth] (8.3,0.198) arc (0:150:0.3);
\node at (8.4,0.5) {$\theta$};
\end{tikzpicture}
\caption{Resolving \textbf{u} into components parallel and
  perpendicular to \textbf{v}. The angle between \textbf{u} and
  \textbf{v} is $0 < \theta < \pi/2$ (left) and $\pi/2 < \theta < \pi$
(right).}
\label{fig:resolving_u_into_parallel_perpendicular_vectors}
\end{figure}

Since $\textbf{u}_{\text{par}}$ and \textbf{v} are parallel, then one
is a scalar multiple of the other, that is
%
\begin{equation}
\label{eq:u_par_parallel_v}
\textbf{u}_{\text{par}}
=
c\textbf{v}
\end{equation}
%
for some scalar $c \neq 0$. Using the parallelogram rule for vector
addition, we have $\textbf{u} = \textbf{u}_{\text{par}} +
\textbf{u}_{\text{per}}$. Then the dot product of \textbf{u} and
\textbf{v} is
%
\begin{equation}
\label{eq:u_per_orthogonal_v}
\textbf{u} \cdot \textbf{v}
=
(\textbf{u}_{\text{par}} + \textbf{u}_{\text{per}}) \cdot \textbf{v}
=
\textbf{u}_{\text{par}} \cdot \textbf{v} +
\textbf{u}_{\text{per}} \cdot \textbf{v}.
\end{equation}
%
By definition, $\textbf{u}_{\text{per}}$ is orthogonal to \textbf{v},
hence their dot product is zero. Using this fact and
substituting~(\ref{eq:u_par_parallel_v})
into~(\ref{eq:u_per_orthogonal_v}), we see that
equation~(\ref{eq:u_per_orthogonal_v}) simplifies to
\[
\textbf{u} \cdot \textbf{v}
=
\textbf{u}_{\text{par}} \cdot \textbf{v}
=
(c \textbf{v}) \cdot \textbf{v}
=
c (\textbf{v} \cdot \textbf{v}).
\]
Solving the last equation for $c$, we have $c = \frac {\textbf{u} \cdot
\textbf{v}} {\textbf{v} \cdot \textbf{v}}$. Substitute this into
equation~(\ref{eq:u_par_parallel_v}) results in
%
\begin{align}
\textbf{u}_{\text{par}}
&=
\frac {\textbf{u} \cdot \textbf{v}} {\textbf{v} \cdot \textbf{v}}
\textbf{v} %
\label{eq:u_par_vector_projection} \\
\textbf{u}_{\text{per}}
&=
\textbf{u} - \textbf{u}_{\text{par}}. %
\label{eq:u_per_scalar_projection}
\end{align}
%
The upshot is that given two non-zero vectors \textbf{u} and
\textbf{v}, equations~(\ref{eq:u_par_vector_projection})
and~(\ref{eq:u_per_scalar_projection}) allow us to resolve \textbf{u}
into two component vectors $\textbf{u}_{\text{par}}$ and
$\textbf{u}_{\text{per}}$ that are, respectively, parallel and
orthogonal to \textbf{v}.

\begin{example}
\index{vectors!projection}
Let $\emph{\textbf{u}} = \langle 3, 4, -5 \rangle$ and
$\emph{\textbf{v}} = \langle -7, 8, 9 \rangle$. Find the projection of
\emph{\textbf{u}} onto \emph{\textbf{v}}, and a vector that is
orthogonal to \emph{\textbf{v}}.
\end{example}

\begin{proof}[Solution]
To compute the projection of \textbf{u} onto \textbf{v}, we use
equation~(\ref{eq:u_par_vector_projection}). So $\textbf{u} \cdot
\textbf{v} = 3(-7) + 4(8) - 5(9) = -34$ and $\textbf{v} \cdot
\textbf{v} = (-7)^2 + 8^2 + 9^2 = 194$. Then
\[
\textbf{u}_{\text{par}}
=
-\frac{34}{194} \langle -7, 8, 9 \rangle
=
\left\langle
\frac{119}{97},\, -\frac{136}{97},\, -\frac{153}{97}
\right\rangle.
\]
Next we use equation~(\ref{eq:u_per_scalar_projection}) to find a
vector that is parallel to \textbf{v}. Then
\[
\textbf{u}_{\text{per}}
=
\langle 3, 4, -5 \rangle -
\left\langle
\frac{119}{97},\, -\frac{136}{97},\, -\frac{153}{97}
\right\rangle
=
\left\langle
\frac{172}{97},\, \frac{524}{97},\, -\frac{332}{97}
\right\rangle
\]
as required.
\end{proof}

\begin{practice}
Let \emph{\textbf{u}} be a vector whose tail is $(-1, 2, 4)$ and whose
head is $(7, -1, 0)$. Let \emph{\textbf{v}} be the vector $\langle 0,
4, 8 \rangle$. Resolve \emph{\textbf{u}} into component vectors that
are parallel and perpendicular to \emph{\textbf{v}}.
\end{practice}

\begin{practice}
Let \emph{\textbf{u}} and \emph{\textbf{v}} be non-zero orthogonal
vectors. What is the projection of \emph{\textbf{u}} onto
\emph{\textbf{v}}? What is the component vector of \emph{\textbf{u}}
that is perpendicular to \emph{\textbf{v}}?
\end{practice}

\begin{practice}
Now suppose that \emph{\textbf{u}} and \emph{\textbf{v}} are non-zero
parallel vectors. What is the projection of \emph{\textbf{u}} onto
\emph{\textbf{v}}? What is the component vector of \emph{\textbf{u}}
that is perpendicular to \emph{\textbf{v}}?
\end{practice}


%%-------------------------------------------------------------------------%%
%%--- Problems ------------------------------------------------------------%%

\subsection{Problems}

\begin{enumerate}
\item Let \textbf{u} and \textbf{v} be vectors, both of which are
  either in two or three dimensions. Show that $\left\Arrowvert
  \textbf{u} \pm \textbf{v} \right\Arrowvert^2 = \left\Arrowvert
  \textbf{u} \right\Arrowvert^2 + \left\Arrowvert \textbf{v}
  \right\Arrowvert^2 \pm 2\textbf{u} \cdot \textbf{v}$.

\item Let \textbf{u} and \textbf{v} be both two- or three-dimensional
  vectors. Use the result from problem~1 to show that \textbf{u} and
  \textbf{v} are orthogonal if and only if $\left\Arrowvert \textbf{u}
  + \textbf{v} \right\Arrowvert^2 = \left\Arrowvert \textbf{u}
  \right\Arrowvert^2 + \left\Arrowvert \textbf{v}
  \right\Arrowvert^2$. This is the vector form of the Pythagorean
  Theorem.\index{Pythagorean Theorem}

\item The Cauchy-Schwarz inequality\index{Cauchy-Schwarz inequality}
  states that for any two vectors \textbf{u} and \textbf{v}, we have
  $|\textbf{u} \cdot \textbf{v}| \leq \left\Arrowvert \textbf{u}
  \right\Arrowvert \, \left\Arrowvert \textbf{v}
  \right\Arrowvert$. Use the result from problem~1 to prove the
  Cauchy-Schwarz inequality. What happens if \textbf{u} and \textbf{v}
  are parallel vectors?

\item In Practices~\ref{prac:triangle_inequality_two_dimensions}
  and~\ref{prac:triangle_inequality_three_dimensions}, we verified the
  triangle inequality $\left\Arrowvert \textbf{u} + \textbf{v}
  \right\Arrowvert \leq \left\Arrowvert \textbf{u} \right\Arrowvert +
  \left\Arrowvert \textbf{v} \right\Arrowvert$ in two and three
  dimensions. Use the result of problem~1 and the Cauchy-Schwarz
  inequality to prove the triangle inequality.\index{triangle inequality}
\end{enumerate}


%%-------------------------------------------------------------------------%%
%%--- The cross product ---------------------------------------------------%%

\section{The cross product}
\index{cross product}

We have seen that scalar multiplication produces a vector, while the
dot product results in a scalar. This section presents another
operation on vectors, called the cross product, that produces
a vector as a result. Unlike scalar multiplication and dot product,
the cross product is not defined for two-dimensional vectors. In order
to define the cross product of vectors in three-dimensional space, we
first need to discuss matrices and determinants.


%%-------------------------------------------------------------------------%%
%%--- Matrices and determinants -------------------------------------------%%

\subsection{Matrices and determinants}
\index{matrix}

A $2 \times 2$ matrix is an array of numbers organized as follows:
%
\begin{equation}
\label{eq:2_by_2_matrix}
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
\end{equation}
%
which has $2$ rows and $2$ columns. Similarly, a $3 \times 3$ matrix
is an array with $3$ rows and $3$ columns:
%
\begin{equation}
\label{eq:3_by_3_matrix}
\begin{bmatrix}
a_1 & a_2 & a_3 \\
b_1 & b_2 & b_3 \\
c_1 & c_2 & c_3
\end{bmatrix}.
\end{equation}
%
Matrices of higher dimensions are similarly defined.

As far as matrices go, they are a convenient notation for organizing a
bunch of numbers. Things get interesting when we take the
\emph{determinant}\index{determinant} of a $2 \times 2$ or
$3 \times 3$ matrix. The determinant of the $2 \times 2$
matrix~(\ref{eq:2_by_2_matrix}) is defined as
\[
\begin{vmatrix}
a & b \\
c & d
\end{vmatrix}
=
ad - bc
\]
which, like the dot product, is a scalar. For example,
\[
\begin{vmatrix}
-2 & 7 \\
9  & 1
\end{vmatrix}
=
-2(1) - 7(9)
=
-65.
\]
The formula for $2 \times 2$ determinants is short and
straightforward. However, the same cannot be said for $3 \times 3$
determinants. The determinant of the $3 \times 3$
matrix~(\ref{eq:3_by_3_matrix}) is defined in terms of $2 \times 2$
determinants as follows:
\[
\begin{vmatrix}
a_1 & a_2 & a_3 \\
b_1 & b_2 & b_3 \\
c_1 & c_2 & c_3
\end{vmatrix}
=
a_1
\begin{vmatrix}
b_2 & b_3 \\
c_2 & c_3
\end{vmatrix}
-
a_2
\begin{vmatrix}
b_1 & b_3 \\
c_1 & c_3
\end{vmatrix}
+
a_3
\begin{vmatrix}
b_1 & b_2 \\
c_1 & c_2
\end{vmatrix}.
\]
For example,
%
\begin{align*}
\begin{vmatrix}
2  & -1 & 5 \\
7  & 6  & 9 \\
-1 & 3  & 4
\end{vmatrix}
&=
2
\begin{vmatrix}
6 & 9 \\
3 & 4
\end{vmatrix}
-
(-1)
\begin{vmatrix}
7  & 9 \\
-1 & 4
\end{vmatrix}
+
5
\begin{vmatrix}
7  & 6 \\
-1 & 3
\end{vmatrix} \\
&= 2 \big( 6(4) - 9(3) \big)
 - (-1) \big( 7(4) - 9(-1) \big)
 + 5 \big( 7(3) - 6(-1) \big) \\
&=
-6 - (-37) + 135 \\
&=
166.
\end{align*}
%
Using \sage, we can compute the determinant as follows:
%
\begin{center}
\fontsize{10pt}{10pt}
\selectfont
\tt
\begin{lstlisting}
sage: m = matrix([[-2, 7], [9, 1]])
sage: m.det()
-65
sage: m = matrix([[2, -1, 5], [7, 6, 9], [-1, 3, 4]])
sage: m.det()
166
\end{lstlisting}
\end{center}
%
We are now ready to define the cross product.

\begin{definition}
Let $\emph{\textbf{u}} = \langle u_1, u_2, u_3 \rangle$ and
$\emph{\textbf{v}} = \langle v_1, v_2, v_3 \rangle$ be
three-dimensional vectors, and let \emph{\textbf{i}},
\emph{\textbf{j}}, and \emph{\textbf{k}} be the standard unit vectors
in three-space. Then the \emph{cross product} of
\emph{\textbf{u}} and \emph{\textbf{v}} is defined as the vector
\[
\emph{\textbf{u}} \times \emph{\textbf{v}}
=
\begin{vmatrix}
u_2 & u_3 \\
v_2 & v_3
\end{vmatrix}
\emph{\textbf{i}}
-
\begin{vmatrix}
u_1 & u_3 \\
v_1 & v_3
\end{vmatrix}
\emph{\textbf{j}}
+
\begin{vmatrix}
u_1 & u_2 \\
v_1 & v_2
\end{vmatrix}
\emph{\textbf{k}}.
\]
\end{definition}

Here is a mnemonic trick to remember the definition of the cross
product:
%
\begin{equation}
\label{eq:mnemonic_cross_product}
\textbf{u} \times \textbf{v}
=
\begin{vmatrix}
\textbf{i} & \textbf{j} & \textbf{k} \\
u_1 & u_2 & u_3 \\
v_1 & v_2 & v_3
\end{vmatrix}.
\end{equation}
%
Note that the entries of a matrix are numbers, not vectors. So
strictly speaking, it does not make sense to have the standard unit
vectors \textbf{i}, \textbf{j}, and \textbf{k} as matrix entries. We
stress that equation~(\ref{eq:mnemonic_cross_product}) is just a trick
to remember the definition of the cross product.

\begin{practice}
Consider the vectors $\emph{\textbf{u}} = \langle 4, 2, 1 \rangle$ and
$\emph{\textbf{v}} = \langle 6, 9, -7 \rangle$. Find the cross
products $\emph{\textbf{u}} \times \emph{\textbf{v}}$ and
$\emph{\textbf{v}} \times \emph{\textbf{u}}$.
\end{practice}

\begin{practice}
Let \emph{\textbf{u}} and \emph{\textbf{v}} be three-dimensional
vectors. Is it true that in general we have $\emph{\textbf{u}} \times
\emph{\textbf{v}} = \emph{\textbf{v}} \times \emph{\textbf{u}}$? State
your reasons.
\end{practice}


%%-------------------------------------------------------------------------%%
%%--- Properties of the cross product -------------------------------------%%

\subsection{Properties of the cross product}
\index{cross product!arithmetic}

Like the dot product, the cross product also shares a number of
arithmetic properties of ordinary
numbers. Theorem~\ref{thm:arithmetic_properties_cross_product} lists
some of these properties in the context of the cross product.

\begin{theorem}
\label{thm:arithmetic_properties_cross_product}
Let \emph{\textbf{u}}, \emph{\textbf{v}}, and \emph{\textbf{w}} be
three-dimensional vectors and suppose $c$ is a scalar. Then the cross
product has the following properties:
%
\begin{enumerate}
\item Anti-commutative: $\emph{\textbf{u}} \times \emph{\textbf{v}} =
  - \emph{\textbf{v}} \times \emph{\textbf{u}}$.

\item Distributive: $\emph{\textbf{u}} \times (\emph{\textbf{v}} +
  \emph{\textbf{w}}) = \emph{\textbf{u}} \times \emph{\textbf{v}} +
  \emph{\textbf{u}} \times \emph{\textbf{w}}$.

\item Distributive: $(\emph{\textbf{u}} + \emph{\textbf{v}}) \times
  \emph{\textbf{w}} = \emph{\textbf{u}} \times \emph{\textbf{w}} +
  \emph{\textbf{v}} \times \emph{\textbf{w}}$.

\item Associative scalar multiplication: $c (\emph{\textbf{u}} \times
  \emph{\textbf{v}}) = (c\emph{\textbf{u}}) \times \emph{\textbf{v}} =
  \emph{\textbf{u}} \times (c\emph{\textbf{v}})$.

\item Zero element: $\emph{\textbf{0}} \times \emph{\textbf{u}} =
  \emph{\textbf{0}} = \emph{\textbf{u}} \times \emph{\textbf{0}}$.

\item Self-inverse: $\emph{\textbf{u}} \times \emph{\textbf{u}} =
  \emph{\textbf{0}}$.
\end{enumerate}
\end{theorem}

\begin{practice}
Let $\emph{\textbf{u}} = \langle u_1, u_2, u_3 \rangle$,
$\emph{\textbf{v}} = \langle v_1, v_2, v_3 \rangle$, and
$\emph{\textbf{w}} = \langle w_1, w_2, w_3 \rangle$. Use the
definition of the cross product to prove the properties in
Theorem~\ref{thm:arithmetic_properties_cross_product}.
\end{practice}

If $\textbf{u} = \langle u_1, u_2, u_3 \rangle$ and
$\textbf{v} = \langle v_1, v_2, v_3 \rangle$ are non-zero, then by the
definition of the cross product we have
%
\begin{align*}
\textbf{u} \times \textbf{v}
&=
\begin{vmatrix}
u_2 & u_3 \\
v_2 & v_3
\end{vmatrix}
\textbf{i}
-
\begin{vmatrix}
u_1 & u_3 \\
v_1 & v_3
\end{vmatrix}
\textbf{j}
+
\begin{vmatrix}
u_1 & u_2 \\
v_1 & v_2
\end{vmatrix}
\textbf{k} \\
&=
\left\langle
u_2 v_3 - u_3 v_2,\; u_3 v_1 - u_1 v_3,\; u_1 v_2 - u_2 v_1
\right\rangle.
\end{align*}
%
The dot product of \textbf{u} and the last equation is
%
\begin{align*}
\textbf{u} \cdot (\textbf{u} \times \textbf{v})
&=
u_1 ( u_2 v_3 - u_3 v_2 ) +
u_2 ( u_3 v_1 - u_1 v_3 ) +
u_3 ( u_1 v_2 - u_2 v_1 ) \\
&=
0.
\end{align*}
%
Again by direct computation, we see that the dot product of \textbf{v}
and $\textbf{u} \times \textbf{v}$ is
%
\begin{align*}
\textbf{v} \cdot (\textbf{u} \times \textbf{v})
&=
v_1 ( u_2 v_3 - u_3 v_2 ) +
v_2 ( u_3 v_1 - u_1 v_3 ) +
v_3 ( u_1 v_2 - u_2 v_1 ) \\
&=
0.
\end{align*}
%
From section~\ref{subsec:properties_dot_product}, we know that two
non-zero vectors are perpendicular if and only if their dot product is
zero. The last two equations show that \textbf{u} and \textbf{v}
are both orthogonal to $\textbf{u} \times \textbf{v}$. In other words,
we have proved the following theorem.

\begin{theorem}
\label{thm:u_v_parallel_u_dot_v}
If \emph{\textbf{u}} and \emph{\textbf{v}} are non-zero vectors in
three-dimensional space, then both of them are orthogonal to
$\emph{\textbf{u}} \times \emph{\textbf{v}}$. That is
\[
\emph{\textbf{u}} \cdot (\emph{\textbf{u}} \times \emph{\textbf{v}})
=
0
=
\emph{\textbf{v}} \cdot (\emph{\textbf{u}} \times \emph{\textbf{v}}).
\]
\end{theorem}

In the same vein, we can also prove
Theorem~\ref{thm:more_properties_cross_product} using direct
calculation. Here is a proof using \sage:
%
\begin{center}
\fontsize{10pt}{10pt}
\selectfont
\tt
\begin{lstlisting}
sage: u_1, u_2, u_3 = var("u_1, u_2, u_3")
sage: v_1, v_2, v_3 = var("v_1, v_2, v_3")
sage: w_1, w_2, w_3 = var("w_1, w_2, w_3")
sage: u = vector([u_1, u_2, u_3])
sage: v = vector([v_1, v_2, v_3])
sage: w = vector([w_1, w_2, w_3])
sage: u.cross_product(v.cross_product(w)) == (u*w)*v - (u*v)*w
True
sage: m = matrix([list(u), list(v), list(w)])
sage: bool(u*(v.cross_product(w)) == m.det())
True
\end{lstlisting}
\end{center}

\begin{theorem}
\label{thm:more_properties_cross_product}
If \emph{\textbf{u}} and \emph{\textbf{v}} are non-zero vectors in
three-dimensional space, then we have
%
\begin{enumerate}
\item $\emph{\textbf{u}} \times (\emph{\textbf{v}} \times
  \emph{\textbf{w}}) = (\emph{\textbf{u}} \cdot \emph{\textbf{w}})
  \emph{\textbf{v}} - (\emph{\textbf{u}} \cdot \emph{\textbf{v}})
  \emph{\textbf{w}}$.

\item $\emph{\textbf{u}} \cdot (\emph{\textbf{v}} \times
  \emph{\textbf{w}}) =
  \begin{vmatrix}
    u_1 & u_2 & u_3 \\
    v_1 & v_2 & v_3 \\
    w_1 & w_2 & w_3
  \end{vmatrix}$.
\end{enumerate}
\end{theorem}


%%-------------------------------------------------------------------------%%
%%--- Applications to geometry --------------------------------------------%%

\subsection{Applications to geometry}

First, we derive a formula analogous to
equation~(\ref{eq:geometric_interpretation_dot_product}), but
involving the sine function, instead of cosine. The formula is stated
in Theorem~\ref{thm:sine_angle_cross_product}. It can be used to
compute the angle between two vectors, but only in three-space because
the cross product is not defined for two-dimensional vectors.

\begin{theorem}
\label{thm:sine_angle_cross_product}
Let $\theta$ be the angle between two vectors \emph{\textbf{u}} and
\emph{\textbf{v}} in three-dimensional space. Then
$\left\Arrowvert \emph{\textbf{u}} \times \emph{\textbf{v}}
\right\Arrowvert = \left\Arrowvert \emph{\textbf{u}} \right\Arrowvert
\, \left\Arrowvert \emph{\textbf{v}} \right\Arrowvert \, \sin \theta$.
\end{theorem}

\begin{proof}
To begin with, we require Lagrange's identity\index{Lagrange's identity}
\[
\left\Arrowvert \textbf{u} \times \textbf{v} \right\Arrowvert^2
=
\left\Arrowvert \textbf{u} \right\Arrowvert^2 \,
\left\Arrowvert \textbf{v} \right\Arrowvert^2
- (\textbf{u} \cdot \textbf{v})^2
\]
which you are invited to prove in
section~\ref{subsec:cross_product_problems}. Assuming Lagrange's
identity and using
equation~(\ref{eq:geometric_interpretation_dot_product}), we have
%
\begin{align*}
\left\Arrowvert \textbf{u} \times \textbf{v} \right\Arrowvert^2
&=
\left\Arrowvert \textbf{u} \right\Arrowvert^2 \,
\left\Arrowvert \textbf{v} \right\Arrowvert^2
- (\textbf{u} \cdot \textbf{v})^2 \\
&=
\left\Arrowvert \textbf{u} \right\Arrowvert^2 \,
\left\Arrowvert \textbf{v} \right\Arrowvert^2
-
\left\Arrowvert \textbf{u} \right\Arrowvert^2 \,
\left\Arrowvert \textbf{v} \right\Arrowvert^2
\cos^2 \theta \\
&=
\left\Arrowvert \textbf{u} \right\Arrowvert^2 \,
\left\Arrowvert \textbf{v} \right\Arrowvert^2
(1 - \cos^2 \theta).
\end{align*}
%
From the trigonometric identity $1 = \cos^2 \theta + \sin^2 \theta$,
we have $\sin^2 \theta = 1 - \cos^2 \theta$ and hence
$\left\Arrowvert \textbf{u} \times \textbf{v} \right\Arrowvert^2 =
\left\Arrowvert \textbf{u} \right\Arrowvert^2 \,
\left\Arrowvert \textbf{v} \right\Arrowvert^2 \, \sin^2 \theta$. As
$\sin \theta \geq 0$ whenever $0 \leq \theta \leq \pi$, take the
square root of both sides of the last equation to obtain
$\left\Arrowvert \textbf{u} \times \textbf{v} \right\Arrowvert
 = \left\Arrowvert \textbf{u} \right\Arrowvert
\, \left\Arrowvert \textbf{v} \right\Arrowvert \, \sin \theta$ as required.
\end{proof}

Theorem~\ref{thm:sine_angle_cross_product} has a geometric
interpretation as measuring the area of a parallelogram. Let
\textbf{u} and \textbf{v} be the base and diagonal vectors,
respectively, of a parallelogram as shown in
Figure~\ref{fig:cross_product_area_parallelogram}. Let $\theta$ be the
angle between these two vectors and suppose $O$ is the height of the
triangle in the figure, where $O$ is opposite to $\theta$. Then we have a
right triangle whose angle $\theta$ and hypotenuse length
$\left\Arrowvert \textbf{v} \right\Arrowvert$ are known, but whose
opposite $O$ is to be determined. Using the trigonometric identity
$\sin \theta = O / \left\Arrowvert \textbf{v} \right\Arrowvert$, we
have $O = \left\Arrowvert \textbf{v} \right\Arrowvert \, \sin
\theta$. The length of $O$ is also the height of the parallelogram,
whose area is given by the formula
%
\begin{equation}
\label{eq:area_parallelogram}
\text{Area of parallelogram}
=
\text{base $\times$ height}.
\end{equation}
%
However, the base of the parallelogram has length $\left\Arrowvert
\textbf{u} \right\Arrowvert$. Applying
Theorem~\ref{thm:sine_angle_cross_product} and
equation~(\ref{eq:area_parallelogram}), the area of the
parallelogram in Figure~\ref{fig:cross_product_area_parallelogram} is
given by $\left\Arrowvert \textbf{u} \times \textbf{v}
\right\Arrowvert = \left\Arrowvert \textbf{u} \right\Arrowvert
\, \left\Arrowvert \textbf{v} \right\Arrowvert \, \sin \theta$.

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
\draw[->,>=stealth,very thick] (0,0) -- node[below]{\textbf{u}} (5,0);
\draw[->,>=stealth,very thick] (0,0) -- node[left]{\textbf{v}} (1.5,2.5);
\draw (1.5,2.5) -- (6.5,2.5);
\draw (5,0) -- (6.5,2.5);
\draw[color=blue,dash pattern=on 4pt off 4pt] (1.5,0) -- (1.5,2.5);
\draw[color=blue] (1.5,0.2) -- (1.7,0.2);
\draw[color=blue] (1.7,0.2) -- (1.7,0);
\draw[->,>=stealth] (0.45,0) arc (0:80:0.3);
\node at (0.6,0.3) {$\theta$};
\node at (2.7,1.25) {$O = \left\Arrowvert \textbf{v} \right\Arrowvert \, \sin \theta$};
\end{tikzpicture}
\caption{Length of the cross product as the area of a parallelogram.}
\label{fig:cross_product_area_parallelogram}
\index{parallelogram}
\end{figure}

\begin{practice}
Consider a right triangle\index{right triangle} whose base is the
vector \emph{\textbf{u}} and having hypotenuse \emph{\textbf{v}}, as
shown in Figure~\ref{fig:cross_product_area_triangle}. If
\emph{\textbf{u}} and \emph{\textbf{v}} are vectors in three-space,
show that the area of the triangle in
Figure~\ref{fig:cross_product_area_triangle} is
$\frac{1}{2} \left\Arrowvert \emph{\textbf{u}} \times
\emph{\textbf{v}} \right\Arrowvert$.
\end{practice}

\begin{figure}[!htpb]
\centering
\begin{tikzpicture}
\draw[->,>=stealth,very thick] (0,0) -- node[below]{\textbf{u}} (3.5,0);
\draw[->,>=stealth,very thick] (0,0) -- node[left]{\textbf{v}} (3.5,3.5);
\draw (3.5,0) -- (3.5,3.5);
\draw (3.5,0) rectangle (3.2,0.3);
\draw[->,>=stealth] (0.54,0) arc (0:75:0.3);
\node at (0.65,0.3) {$\theta$};
\node at (3.7,1.75) {$O$};
\end{tikzpicture}
\caption{Area of a right triangle in terms of the cross product.}
\label{fig:cross_product_area_triangle}
\end{figure}

\begin{figure}[!htpb]
\centering
\begin{pspicture}(0,-0.1)(5,2.5)
% \pstThreeDCoor[linecolor=black,Alpha=-200,Beta=10,xMin=-0.5,xMax=4,yMin=-0.5,yMax=4,zMin=-0.5,zMax=4]
\pstThreeDLine[linewidth=1.5pt,arrows=->,Alpha=-200,Beta=10](0,0,0)(4,0,0)
\pstThreeDLine[linewidth=1.5pt,arrows=->,Alpha=-200,Beta=10](0,0,0)(0.5,0,2)
\pstThreeDLine[linewidth=1.5pt,arrows=->,Alpha=-200,Beta=10,linestyle=dashed](0,0,0)(0.5,3,0)
\pstThreeDLine[linewidth=1.5pt,arrows=->,Alpha=-200,Beta=10](0,0,0)(0,0,3)
\pstThreeDLine[Alpha=-200,Beta=10,linestyle=dashed,linewidth=0.4pt](0.5,3,0)(4.5,3,0)
\pstThreeDLine[Alpha=-200,Beta=10,linestyle=dashed,linewidth=0.4pt](0.5,3,0)(1,3,2)
\pstThreeDLine[Alpha=-200,Beta=10,linewidth=0.4pt](4,0,0)(4.5,0,2)
\pstThreeDLine[Alpha=-200,Beta=10,linewidth=0.4pt](0.5,0,2)(4.5,0,2)
\pstThreeDLine[Alpha=-200,Beta=10,linewidth=0.4pt](0.5,0,2)(1,3,2)
\pstThreeDLine[Alpha=-200,Beta=10,linewidth=0.4pt](4,0,0)(4.5,3,0)
\pstThreeDLine[Alpha=-200,Beta=10,linewidth=0.4pt](4.5,3,0)(5,3,2)
\pstThreeDLine[Alpha=-200,Beta=10,linewidth=0.4pt](4.5,0,2)(5,3,2)
\pstThreeDLine[Alpha=-200,Beta=10,linewidth=0.4pt](1,3,2)(5,3,2)
\uput[0](2,-0.35){\textbf{u}}
\uput[0](0.2,1){\textbf{v}}
\uput[0](0.5,0.5){\textbf{w}}
\uput[0](-1.3,2.5){$\textbf{u} \times \textbf{w}$}
\end{pspicture}
\caption{Volume of a parallelepiped in terms of dot and cross products.}
\label{fig:volume_parallelepiped_cross_dot_products}
\index{parallelepiped}
\end{figure}

Using a similar argument, we can derive a formula for the volume of a
parallelepiped in terms of the dot and cross products. Consider the
parallelepiped in
Figure~\ref{fig:volume_parallelepiped_cross_dot_products} whose
adjacent vectors are \textbf{u}, \textbf{v}, and \textbf{w}. From
Figure~\ref{fig:cross_product_area_parallelogram} and
Theorem~\ref{thm:sine_angle_cross_product}, the base area of the
parallelepiped is $\left\Arrowvert \textbf{u} \times \textbf{w}
\right\Arrowvert$. From Theorem~\ref{thm:u_v_parallel_u_dot_v} we know
that both \textbf{u} and \textbf{w} are perpendicular to
$\left\Arrowvert \textbf{u} \times \textbf{w} \right\Arrowvert$. Let
$\theta$ be the angle between $\left\Arrowvert \textbf{u} \times
\textbf{w} \right\Arrowvert$ and \textbf{v}, and let $h$ be the height
of the parallelepiped. Recall the cosine rule $\cos \theta = h /
\left\Arrowvert \textbf{v} \right\Arrowvert$ and so the height of the
parallelepiped is $h = \left\Arrowvert \textbf{v} \right\Arrowvert
\cos \theta$. Recall that
\[
\text{Volume of parallelepiped}
=
\text{height} \times \text{area of base}.
\]
Then the required volume is $V = \left\Arrowvert \textbf{u} \times
\textbf{w} \right\Arrowvert \, \left\Arrowvert \textbf{v}
\right\Arrowvert \cos \theta$. Apply
equation~(\ref{eq:geometric_interpretation_dot_product}) to obtain
\[
\text{Volume of parallelepiped}
=
(\textbf{u} \times \textbf{w}) \cdot \textbf{v}.
\]


%%-------------------------------------------------------------------------%%
%%--- Problems ------------------------------------------------------------%%

\subsection{Problems}
\label{subsec:cross_product_problems}

\begin{enumerate}
\item Let \textbf{u} and \textbf{v} be three-dimensional vectors. Show
  that
\[
\left\Arrowvert \textbf{u} \times \textbf{v} \right\Arrowvert^2
=
\left\Arrowvert \textbf{u} \right\Arrowvert^2 \,
\left\Arrowvert \textbf{v} \right\Arrowvert^2 -
(\textbf{u} \cdot \textbf{v})^2.
\]
This is known as Lagrange's identity, named after Joseph-Louis
Lagrange~(1736--1813).
\index{Lagrange's identity}
\index{Lagrange, Joseph-Louis}

\item Let \textbf{u}, \textbf{v}, and \textbf{w} be vectors in
  three-dimensional space. Show that
\[
(\textbf{u} \times \textbf{v}) \times \textbf{w} +
(\textbf{v} \times \textbf{w}) \times \textbf{u} +
(\textbf{w} \times \textbf{u}) \times \textbf{v}
=
\textbf{0}.
\]
This is known as Jacobi's identity, named after Carl Gustav Jacob
Jacobi (1804--1851).
\index{Jacobi's identity}
\index{Jacobi, Carl Gustav Jacob}

\item How would you use Theorem~\ref{thm:sine_angle_cross_product} to
  prove the inequality
  $\left\Arrowvert \textbf{u} \times \textbf{v} \right\Arrowvert
  \leq \left\Arrowvert \textbf{u} \right\Arrowvert \,
  \left\Arrowvert \textbf{v} \right\Arrowvert$?

\item Let \textbf{u} and \textbf{v} be both non-zero vectors in
  three-space. Show that \textbf{u} and \textbf{v} are parallel if and
  only if $\textbf{u} \times \textbf{v} = \textbf{0}$.

\item Consider the tetrahedron\index{tetrahedron} in
  Figure~\ref{fig:volume_tetrahedron_cross_dot_products} where the
  vectors \textbf{u}, \textbf{v}, and \textbf{w} are adjacent sides
  having a common origin. Show that the volume $V$ of the tetrahedron
  can be expressed in terms of dot and cross products as
\[
V
=
\frac{1}{6}
\left|
\textbf{u} \cdot (\textbf{v} \times \textbf{w})
\right|.
\]
  This equation is known as Euler's formula, named after Leonhard
  Euler~(1707--1783).
\index{Euler's formula}
\index{Euler, Leonhard}

\begin{figure}[!htpb]
\centering
\begin{pspicture}(0,-0.7)(4,2)
% \pstThreeDCoor[linecolor=black,Alpha=-220,xMin=-0.5,xMax=4,yMin=-0.5,yMax=4,zMin=-0.5,zMax=3]
\pstThreeDLine[linewidth=1.5pt,arrows=->,Alpha=-220](0,0,0)(3,0,0)
\pstThreeDLine[linewidth=1.5pt,arrows=->,Alpha=-220,linestyle=dashed](0,0,0)(2.5,2.2,0)
\pstThreeDLine[linewidth=1.5pt,arrows=->,Alpha=-220](0,0,0)(1.5,2,2)
\pstThreeDLine[linewidth=0.4pt,Alpha=-220](3,0,0)(1.5,2,2)
\pstThreeDLine[linewidth=0.4pt,Alpha=-220](2.5,2.2,0)(1.5,2,2)
\pstThreeDLine[linewidth=0.4pt,Alpha=-220](3,0,0)(2.5,2.2,0)
\uput[0](1,-0.8){\textbf{u}}
\uput[0](1.2,1.5){\textbf{v}}
\uput[0](1,0.2){\textbf{w}}
\end{pspicture}
\caption{Volume of a tetrahedron in terms of dot and cross products.}
\label{fig:volume_tetrahedron_cross_dot_products}
\end{figure}
\end{enumerate}


%%-------------------------------------------------------------------------%%
%%--- Lines and planes ----------------------------------------------------%%

% \section{Lines and planes}


%%-------------------------------------------------------------------------%%
%%--- Lines in three-space ------------------------------------------------%%

% \subsection{Lines in three-space}

% In section~\ref{subsec:2D_vectors_apply_geometry} we found that any line
% in the $x$-$y$ plane can be represented in vector form. We now
% investigate how to obtain the vector form of lines in
% three-dimensional space.
